/**
 * Created by Administrator on 2017/3/13 0013.
 */
Page4={
    Create:function(){
        var page={};
        var whole=new PIXI.DisplayObjectContainer();

        var bgL = PSP("page4_1");
        var bgR = PSP("page4_2");
        var head1=PSP("page4_3");
        var head2=PSP("page4_4");
        var head3=PSP("page4_5");
        var word1=PSP("page4_6");
        var word2=PSP("page4_7");
        var word3=PSP("page4_8");

        var bgLMask=new PIXI.Graphics();
        bgLMask.beginFill(0x000000,1);
        bgLMask.drawRect(0,0,370,1136);
        whole.addChild(bgLMask);
        bgL.mask=bgLMask;
        bgLMask.x=1;

        var bgRMask=new PIXI.Graphics();
        bgRMask.beginFill(0x000000,1);
        bgRMask.drawRect(0,0,370,1136);
        bgRMask.x=369;
        whole.addChild(bgRMask);
        bgR.mask=bgRMask;




        whole.addChild(bgL);
        whole.addChild(bgR);
        whole.addChild(head1);
        whole.addChild(head2);
        whole.addChild(head3);
        whole.addChild(word1);
        whole.addChild(word2);
        whole.addChild(word3);

        bgL.x=0;bgL.y=0;
        bgR.x=370;bgR.y=0;
        head1.x=314;head1.y=36;
        head2.x=371;head2.y=125;
        head3.x=282;head3.y=203;
        word1.x=404;word1.y=328;
        word2.x=404;word2.y=370;
        word3.x=404;word3.y=413;

        bgL.x=370;bgR.x=0;
        head1.alpha=0;
        head2.alpha=0;
        head3.alpha=0;
        word1.alpha=0;
        word2.alpha=0;
        word3.alpha=0;
        var delayTime=0.5;
        whole.alpha=0;
        page.start=function(){
            whole.alpha=1;
            bgL.x=370;bgR.x=0;
            head1.alpha=0;
            head2.alpha=0;
            head3.alpha=0;
            word1.alpha=0;
            word2.alpha=0;
            word3.alpha=0;
            TweenMax.to(bgL,1,{x:0,ease:Cubic.easeOut});
            TweenMax.to(bgR,1,{x:370,ease:Cubic.easeOut});

            head1.y=10;
            head2.x=391;
            head3.x=260;
            TweenMax.to(head1,1,{delay:0.0+delayTime,alpha:1,y:36,ease:Cubic.easeOut});
            TweenMax.to(head2,1,{delay:0.3+delayTime,alpha:1,x:371,ease:Cubic.easeOut});
            TweenMax.to(head3,1,{delay:0.6+delayTime,alpha:1,x:282,ease:Cubic.easeOut});

            word1.x=444;
            word2.x=444;
            word3.x=444;
            TweenMax.to(word1,0.7,{delay:1+delayTime,alpha:1,x:404,ease:Cubic.easeOut});
            TweenMax.to(word2,0.7,{delay:1.2+delayTime,alpha:1,x:404,ease:Cubic.easeOut});
            TweenMax.to(word3,0.7,{delay:1.4+delayTime,alpha:1,x:404,ease:Cubic.easeOut});
        }

        page.end=function(){

            TweenMax.to(whole,0.01,{delay:1.4,alpha:0});

            TweenMax.to(head1,0.5,{delay:0.0,alpha:0,ease:Cubic.easeOut});
            TweenMax.to(head2,0.5,{delay:0.1,alpha:0,ease:Cubic.easeOut});
            TweenMax.to(head3,0.5,{delay:0.2,alpha:0,ease:Cubic.easeOut});
            TweenMax.to(word1,0.5,{delay:0.3,alpha:0,ease:Cubic.easeOut});
            TweenMax.to(word2,0.5,{delay:0.4,alpha:0,ease:Cubic.easeOut});
            TweenMax.to(word3,0.5,{delay:0.5,alpha:0,ease:Cubic.easeOut});

            TweenMax.to(bgL,1,{delay:0.4,x:370,ease:Cubic.easeOut});
            TweenMax.to(bgR,1,{delay:0.4,x:0,ease:Cubic.easeOut});
        }


        page.In=function(){

        }
        page.Out=function(){

        }

        page.ReturnWhole=function(){
            return whole;
        };

        return page;
    }
}
